import request from "@/utils/http";
import type { Result, ChatVo } from "@/types";

const chat = {
  createChat(title: string, contentType: string) {
    return request.post("/block/createChat", {
      title: title,
      contentType: contentType,
    }) as Promise<Result<ChatVo>>;
  },
  getChatList(contentType: string) {
    return request.get("/block/getChatList", {
      contentType: contentType,
    }) as Promise<Result<ChatVo[]>>;
  },
  delChat(id: number) {
    return request.delete(`/gpt/chat/${id}`) as Promise<Result<void>>;
  },
};

export default chat;
